<%-- 
    Document   : jsonObtenerIdDocumentoTramite
    Created on : 25/08/2010, 12:30:34 PM
    Author     : GCC
--%>

<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.text.DateFormat"%>
<%@ page contentType="application/json; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page import="pe.gob.pnp.despachadores.*" %>
<%@ page import="pe.gob.pnp.actions.*" %>
<%@ page import="java.util.*"%>
<%@ page import="pe.gob.pnp.libreria.Utiles"%>

<%
String fecha = "";
try {

            DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
            String param = request.getParameter("ffin");
            //System.out.println( "Fecha " + param );
            String fechaFin =  param;            
            GregorianCalendar ffin = new GregorianCalendar();
            ffin.setTime(df.parse(fechaFin));
           // System.out.println("Fecha Fin (1) " + df.format(ffin.getTime()));

            String dfin  = ""+ ( ffin.get(Calendar.DAY_OF_MONTH ) + 1);
            String mfin = ""+ ( ffin.get(Calendar.MONTH) +1);
            String afin = ""+ffin.get(Calendar.YEAR);
            //System.out.println("Fecha armada fin "+dfin + "/"+ mfin +"/"+ afin+"");
            ffin.setTime(df.parse( dfin+"/"+mfin+"/"+afin ));
            //System.out.println("f Inicio " + df.format(fini.getTime()));
            df = new SimpleDateFormat("MM/dd/yyyy");
            fecha = df.format(ffin.getTime());
            //System.out.println("Fecha fin (2) " +  fecha );

        } catch (Exception ex) {
            System.out.println(ex.getMessage());
        }
   
%>
{
    fecha:"<%=fecha %>"
}